package ronglei.day01.demo06ArrayList;
/*
* 定义一个数组用来储存三个对象
* 数组一旦创建运行期间长度不会变
* */
public class Array01 {
    public static void main(String[] args) {
        //重建一个长度位3的数组
        Person[] array = new Person[3];
        Person one = new Person("荣磊",18);
        Person two = new Person("古力娜扎",19);
        Person three = new Person("迪丽热巴",10);
        array[0] = one;
        array[1] = two;
        array[2] = three;
        System.out.println(array[0].getName());
        System.out.println(array[1]);
        System.out.println(array[2].getAge());
    }
}
